home *** CD-ROM | disk | FTP | other *** search
- Path: newdelph.cig.mot.com!usenet
- From: Martin O'Hara <oharam>
- Newsgroups: comp.lang.c++
- Subject: VTAB REPLICATION / OULINED INLINES
- Date: 28 Mar 1996 15:07:36 GMT
- Organization: Motorola Cellular Infrastructure Group
- Message-ID: <4je9vo$386@newdelph.cig.mot.com>
- NNTP-Posting-Host: liath202.cork.cig.mot.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1 (X11; I; SunOS 4.1.3_U1 sun4m)
- X-URL: news:comp.lang.c++
-
- Hi there,
-
- I posted an article in or around 8-9 March with a couple of C++ questions but
- Ive been away in the mean time and so didnt get a chance to check for replies
- on this group. So once again if anyone has the definintive answers to the
- questions below please mail me at oharam@cork.cig.mot.com
-
- Outlined inlines :
-
- A : If the programmer declares a function to be inline but the compiler decides
- that it cant be made inline ( recursive function, function too big, address of
- function taken in code) what happens?
-
-
- B : Will the compiler generate inline calls for such a function wherever
- possible and generate an "outlined inline" in each translation unit where
- inlining isnt possible. In other words can both an inlined version of a
- function and an outlined version( callable function local to translation unit)
- be present in a program.
-
- For example if we have
-
- inline int f()
- {
- return x;
- }
-
- Say this is called in A.C - It can be inlined here
- However if B.C contains code which takes the address of f() then a callable
- function must be generated??
-
-
- VTAB Replication:
-
- Most smart compilers use a heuristic for deciding where to put the VTAB which
- is
- in the file where the first non inline virtual function of a class is defined
- Is the VTAB for a class having no non inline virtual functions( ie all virtual
- functions are inline ones) replicated in each translation unit in which the
- header for that class is included? Does this happen in any other cases??
-
- Cheers
-
- /Martin
-
-